package com.huangjue.backend.service.impl;

import com.huangjue.backend.entity.Message;
import com.huangjue.backend.mapper.MessageMapper;
import com.huangjue.backend.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageServiceImpl implements MessageService {
    @Autowired
    private MessageMapper messageMapper;

    @Override
    public List<Message> getMessagesByUserId(Integer userId) {
        return messageMapper.selectMessagesByUserId(userId);
    }

    @Override
    public int markMessageRead(Integer messageId) {
        return messageMapper.markMessageRead(messageId);
    }

    @Override
    public int selectNoReadMessageCount(Integer userId) {
        return messageMapper.selectNoReadMessageCount(userId);
    }


} 